package com.fdb.efp.nls.service.yed.common.rules.credit;

import com.fdb.basic.framework.core.constant.EsbRetCodeStandard;
import com.fdb.basic.framework.core.exception.BizException;
import com.fdb.efp.nls.service.yed.common.rules.CheckRule;

import java.math.BigDecimal;
import java.util.Objects;

/**
 * 需求编号:2019D08--
 * 问题编号:
 * 开发人员: caoxin
 * 创建日期:2020/3/25
 * 功能描述:
 * 修改日期:2020/3/25
 * 修改描述:
 */
public class CreditInfoApproveAmt implements CheckRule {
    private BigDecimal approveAmt;

    public CreditInfoApproveAmt(BigDecimal approveAmt) {
        this.approveAmt = approveAmt;
    }

    @Override
    public void check() throws BizException {
        if (Objects.isNull(approveAmt) || BigDecimal.ZERO.compareTo(approveAmt) == 0) {
            throw new BizException(EsbRetCodeStandard.WFJKYWGZ.getValue(), "风控审批返回审批金额为空，授信拒绝！");
        }
    }
}
